class Solution:
    def splitString(self, s: str, last=None) -> bool:
        if last is None:
            last = []

        if not s and len(last) >= 2:
            return True

        for i in range(1, len(s) + 1):
            now = int(s[:i])
            if last and now != last[-1] - 1:
                continue

            last.append(now)
            surplus = s[i:]
            if self.splitString(surplus, last):
                return True
            last.pop()

        return False


if __name__ == "__main__":
    print(Solution().splitString("1234"))  # False
    print(Solution().splitString("050043"))  # True
    print(Solution().splitString("9080701"))  # False
    print(Solution().splitString("10009998"))  # True
